package com.excuse.excusebuilder.commen.util;

import android.content.Context;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;

/**
 * Created by U-nookia on 2017/3/20.
 */

public class NetWorkUtil {
    public static boolean netWorkConnected;

    /*
   判断是否有连接可用的网络
    */
    public static boolean isNetWorkConnected(Context context){
        if (context!=null) {
            ConnectivityManager manager = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
            NetworkInfo info = manager.getActiveNetworkInfo();
            if (info != null&&info.isConnected()) {
                return true;
            }
        }
        return false;
    }
}
